const mongoose = require('mongoose')
const Schema = mongoose.Schema

const menuSchema = new Schema({
  "_id": Object,
  "id": String,
  "pid": String,
  "name": String,
  "link": String,
  "icon": String,
  "children": [
    {
      "id": String,
      "pid": String,
      "name": String,
      "link": String,
      "icon": String
    }
  ]
})

module.exports = mongoose.model('menu', menuSchema, 'menu')
